package howe.sudoku.db;

import android.provider.BaseColumns;

public class SudokuSimpleSQL implements BaseColumns {

    public static final String SUDOKU_TABLE_NAME = "sudoku";

    public static final String FOLDER_ID = "folder_id";
    public static final String CREATED = "created";
    public static final String STATE = "state";
    public static final String TIME = "time";
    public static final String LAST_PLAYED = "last_played";
    public static final String DATA = "data";
    public static final String READ_ONLY_DATA = "readonlydata";
    public static final String PUZZLE_NOTE = "puzzle_note";

    public static final int GAME_STATE_PLAYING = 0;
    public static final int GAME_STATE_NOT_STARTED = 1;
    public static final int GAME_STATE_COMPLETED = 2;

    public static final String CREATE_TABLE =
            "CREATE TABLE " + SUDOKU_TABLE_NAME + " ("
                    + _ID + " INTEGER PRIMARY KEY,"
                    + FOLDER_ID + " INTEGER,"
                    + CREATED + " INTEGER,"
                    + STATE + " INTEGER,"
                    + TIME + " INTEGER,"
                    + LAST_PLAYED + " INTEGER,"
                    + DATA + " Text,"
                    + READ_ONLY_DATA + " Text,"
                    + PUZZLE_NOTE + " Text"
                    + ");";

    public static final String CREATE_INDEX =
            "create index "+ SUDOKU_TABLE_NAME+
            "_idx1 on "+
            SUDOKU_TABLE_NAME+" ("+FOLDER_ID+");";
    public static final String INSERT =
            "INSERT INTO " + SUDOKU_TABLE_NAME +
            " VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s');";
}
